from pages.lyz.pycache.account import left_menu_sys, left_menu, name_send, id_send, account_btn, find_expected, \
    pipelining, \
    number, pipelining_cancel
import time

from pages.page import Page


class AccountPage(Page):
    '''
    报表查询--账户统计
    '''

    # 查询UI测试
    def open_sales_order(self):
        '''
        打开管理员UI，如果已经打开则不会执行单击动作
        :return:
        '''
        if self.display(left_menu) is False:  # 如果是隐藏状态则单击
            self.click(left_menu_sys)
        self.click(left_menu)

    def name_send(self, value):
        self.send_keys(name_send, value)
        time.sleep(1)

    def id_send(self, value):
        self.send_keys(id_send, value)
        time.sleep(1)

    def account_btn(self):
        self.click(account_btn)

    def search_result_text(self):
        '''
        单击查找完成后，获取查找结果
        :return:
        '''
        return self.text(find_expected)

    def pipelining(self):
        self.click(pipelining)
        time.sleep(1)

    def number(self):
        self.click(number)
        time.sleep(1)


    def pipelining_cancel(self):
        self.click(pipelining_cancel)
        time.sleep(1)
